package com.mentalhealthplatform.studentV3.repository;

import com.mentalhealthplatform.appModels.Reply;
import io.lettuce.core.dynamic.annotation.Param;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @author Pear
 */
public interface ReplyRepositoryV3 extends JpaRepository<Reply, Long> {
    // 使用 @Query 注解
    @Query("SELECT r FROM Reply r WHERE r.message.id = :messageId")
    List<Reply> findByMessageId(@Param("messageId") Long messageId);
}
